package com.woniu.controller.chargingManage;

import com.woniu.entity.ChargingStation;
import com.woniu.entity.dto.RealTimeMonitoring.chargingManage.ChargingStationDTO;
import com.woniu.service.ChargingStationService;
import com.woniu.service.liuwei.LiuChargingStationService;
import com.woniu.util.PageData;
import com.woniu.util.ResponseData;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/chargingStationManage")
public class ChargingStationManageController {

    @Resource
    private LiuChargingStationService liuChargingStationService;


    /**
    * 根据条件查询充电桩的信息(String queryParam)
    * */
    @PostMapping("/queryChargingStation")
    public ResponseData<?> queryChargingStation(@RequestBody PageData<ChargingStationDTO> pageData) {
        return liuChargingStationService.queryChargingStation(pageData);
    }

    /**
     * 根据ids，删除ChargingStation表中的字段
     * 逻辑删除
    * */
    @GetMapping("/batchDel/{ids}")
    public ResponseData<?> batchDel(@PathVariable("ids") List<Integer> ids) {
        return liuChargingStationService.batchDel(ids);
    }
}
